package com.cangxuan.manage.controller;

import com.cangxuan.manage.annotation.Check;
import com.cangxuan.manage.annotation.check.Max;

import com.cangxuan.manage.annotation.check.NotNull;
import com.cangxuan.manage.bean.Page;
import com.cangxuan.manage.entity.Issuer;

import com.cangxuan.manage.service.IIssuerService;
import io.swagger.annotations.*;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "发行方相关接口")
@RestController
@RequestMapping("issuer")
public class IssuerController extends BaseController{

        IIssuerService issuerService;
        @Autowired
        public void setGoodsService(IIssuerService issuerService) {
            this.issuerService = issuerService;
        }

        @GetMapping()
        @ApiOperation("查询发行方")
        public Object get(){
        return success("请求成功", issuerService.getIssuer());
    }


        @PostMapping("save")
        @ApiOperation("保存发行方")
        public Object save(@Check @RequestBody Issuer issuer) {
            issuerService.save(issuer);
            return success();
        }


        @GetMapping("delete")
        @ApiOperation("删除发行方")
        public Object delete(@RequestParam int id) {
            issuerService.delete(id);
            return success();
        }
    }


